home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_lightning.cog < prev    next >
Text File  |  1999-11-15  |  18KB  |  799 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_Lightning.cog
  4. #
  5. # [RT] [TL] [SXC] [GGJ] [HB]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message    startup
  13. message    activated
  14. message    arrived
  15. message    touched
  16. message    pulse
  17. message    user0
  18. message    user1
  19. message    user2
  20. message    entered
  21.  
  22. # ***** COGS ********************************************************
  23.  
  24. cog        nub_Commie_Grid    # Commie control
  25.  
  26. # ***** LINKED GEOMETRY *********************************************
  27.  
  28. sector    triggersector
  29.  
  30. surface    climbout
  31. surface    climbFace
  32.  
  33. # ***** LOCAL GEOMETRY **********************************************
  34.  
  35. sector    targetSector    local
  36.  
  37. # ***** LINKED THINGS ***********************************************
  38.  
  39. thing    probe
  40. thing    button
  41.  
  42. thing    blastDoor1
  43.  
  44. # ***** NO LINK THINGS **********************************************
  45.  
  46. thing    head0            nolink
  47. thing    head1            nolink
  48. thing    head2            nolink
  49.  
  50. thing    indy            nolink
  51. thing    introIndy        nolink
  52.  
  53. thing    commie0            nolink
  54. thing    commie1            nolink
  55. thing    commie2            nolink
  56. thing    volodnikov        nolink
  57.  
  58. thing    commieTarg0        nolink
  59. thing    commieTarg1        nolink
  60. thing    commieTarg2        nolink
  61.  
  62. thing    blastDoor0        nolink
  63.  
  64. thing    cam0            nolink
  65. thing    cam1            nolink
  66. thing    cam2            nolink
  67. thing    volCam            nolink
  68. thing    indyCam            nolink
  69. thing    volCamTarg        nolink
  70. thing    indytarg        nolink
  71. thing    probetarg        nolink    
  72. thing    zaptarg            nolink
  73. thing    lt_mk_1            nolink
  74.  
  75. thing    tower            nolink
  76. thing    lightningGhost    nolink
  77.  
  78. thing    buttonTarget    nolink
  79. thing    ballTarget        nolink
  80. thing    camTarget        nolink
  81. thing    volExitTarg        nolink
  82.  
  83. thing    randtarget0        nolink
  84. thing    randtarget1        nolink
  85. thing    randtarget2        nolink
  86. thing    randtarget3        nolink
  87. thing    randtarget4        nolink
  88. thing    randtarget5        nolink
  89.  
  90. # ***** LOCAL THINGS ************************************************
  91.  
  92. thing    player            local
  93. thing    deadIndy        local
  94. thing    sender            local
  95. thing    source            local
  96. thing    curCamLocus        local
  97. thing    curCamFocus        local
  98. thing    curTarget        local
  99. thing    glow            local
  100. thing    tempThing        local
  101.  
  102. # ***** MODELS ******************************************************
  103.  
  104. model    mod_VoGun=weap_tokarev.3do            local
  105. model    mod_VoHolster=holster_vo_notok.3do    local
  106.  
  107. # ***** SOUNDS ******************************************************
  108.  
  109. sound    chargingSnd=nub_aethlight_on_c.wav    local
  110. sound    fireSnd=gen_lightning_c.wav            local
  111. sound    hitSnd=gen_lightning_contact_c.wav    local
  112. sound    interestingSnd=INXJ001B.WAV            local
  113. sound    uhohSnd=INXJ009.WAV                    local
  114. sound    comMus=mus_gen_russbold_shrt2.wav    local
  115. sound    ballMus=mus_gen_awechord1.wav        local
  116.  
  117. # ***** TEMPLATES ***************************************************
  118.  
  119. template    sparksTpl=bluesparks            local
  120. template    smokeTpl=+pistol_smoke1            local
  121. template    lightHitTpl=+lightninghit        local
  122. template    ghostTpl=ghost                    local
  123. template    glowTpl=+tower_glow                local
  124.  
  125. # ***** MATERIALS ***************************************************
  126.  
  127. material    zapMat0=inf_4sfx_lightning_a.mat    local
  128. material    zapMat1=inf_4sfx_lightning_b.mat    local
  129. material    zapMat2=inf_4sfx_lightning_c.mat    local
  130.  
  131. material    ballMat=probe_ball_side.mat            local
  132.  
  133. # ***** KEYFRAMES ***************************************************
  134.  
  135. keyframe    vo_Command=0vo_rightup_3_3.key            local
  136. keyframe    in_Shock=in_activate_medium_shock.key    local
  137. keyframe    in_DieShock=in_die_shocked.key            local
  138. keyframe    in_Reaction=0in_reaction.key            local
  139. keyframe    cm_LookAround=01h_sailor_lookaround.key    local
  140.  
  141. # ***** BOOLS *******************************************************
  142.  
  143. int        b_Disabled=0        local
  144. int        b_IntroDone=0        local
  145. int        b_CommieIntroDone=0    local
  146. int        b_CommieKilled=0    local
  147. int        b_LightningOn=0        local
  148. int        b_ZappedIndy=0        local
  149. int        b_TouchOfDeath=0    local
  150.  
  151. # ***** MISC. LOCAL VARIABLES ***************************************
  152.  
  153. int        count                local
  154. int        index                local
  155.  
  156. int        comFrame0=0            local
  157. int        comFrame1=0            local
  158. int        comFrame2=0            local
  159.  
  160. int        curFrame            local
  161. int        curDamage            local
  162.  
  163. int        moveStatus            local
  164.  
  165. flex    strikeRate=6.0        local
  166. flex    inRotRate            local
  167. flex    inHeadRate            local
  168.  
  169. vector    targetPos            local
  170.  
  171. # ***** SUBROUTINES *************************************************
  172.  
  173. flex    SetTargetRandom        local
  174. flex    LightningStrike        local
  175. flex    LightningIntro        local
  176. flex    CommieIntro            local
  177. flex    KillCommie            local
  178.  
  179. end
  180.  
  181. # ===================================================================
  182.  
  183. code
  184.  
  185. startup:
  186.  
  187. player = GetLocalPlayerThing();
  188.  
  189. # Disable commies & Volodya
  190. for(index = 0; index < 4; index = index + 1)
  191. {
  192.     AISetCutsceneMode(commie0[index]);
  193.     SetThingFlags(commie0[index], 0x80000);
  194. }
  195.  
  196. # Clear stand on bit on tower
  197. ClearThingFlags(tower, 0x40);
  198.  
  199. SetThingLight(button, '1.0 1.0 1.0', 0.01, 1.0);
  200.  
  201. return;
  202.  
  203. # -------------------------------------------------------------------
  204.  
  205. activated:
  206.  
  207. if (b_Disabled) return;
  208.  
  209. if (GetSenderRef() == button)
  210. {
  211.     if (GetCurFrame(button) != 0) return;
  212.  
  213.     # Setup...
  214.     MakeMeStop();
  215.     DeselectWeaponWait(player);
  216.  
  217.     StartCutscene(1);
  218.     CopyPlayerHolsters(player, indy);
  219.     ClearThingFlags(indy, 0x80000);
  220.     SetThingFlags(player, 0x80000);
  221.  
  222.     # Cut to camera watching Indy
  223.     curCamLocus = CreateThing(ghostTpl, cam2);
  224.     curCamFocus = CreateThing(ghostTpl, buttonTarget);
  225.     SetCameraFocus(2, curCamLocus);
  226.     SetCameraSecondaryFocus(2, curCamFocus);
  227.     SetCurrentCamera(2);
  228.  
  229.     # Indy presses button.
  230.     PlayMode(indy, 60, 0);
  231.     Sleep(0.2);
  232.     MoveToFrame(button, 1, 1);
  233.     Sleep(0.5);
  234.  
  235.     # Move camera and target to watch ball and doors rise.
  236.     MoveThingToPos(curCamLocus, GetThingPos(camTarget), 2.0);
  237.     MoveThingToPos(curCamFocus, GetThingPos(ballTarget), 2.0);
  238.     SetCameraFOV(120, 1, 2.0);
  239.  
  240.     # No bumpin' into things...
  241.     SetCollideType(probe, 0);
  242.     SetCollideType(blastDoor0, 0);
  243.     SetCollideType(blastDoor1, 0);
  244.  
  245.     # Move stuff
  246.     curFrame = 1 - GetCurFrame(probe);
  247.     MoveToFrame(probe, curFrame, 1);
  248.     MoveToFrame(blastDoor0, curFrame, 1);
  249.     Sleep(0.01);
  250.     MoveToFrame(blastDoor1, curFrame, 1);
  251. }
  252. return;
  253.  
  254. # -------------------------------------------------------------------
  255.  
  256. arrived:
  257.  
  258. sender = GetSenderRef();
  259.  
  260. if (sender == probe)
  261. {
  262.     SetCollideType(probe, 3);
  263.  
  264.     if (GetCurFrame(probe) == 0)
  265.     {
  266.         if (!b_CommieIntroDone)
  267.         {
  268.             call CommieIntro;
  269.         }
  270.     }
  271.     else if (b_IntroDone && !b_CommieKilled)
  272.     {
  273.         if (b_LightningOn)
  274.         {
  275.             b_CommieKilled = 1;
  276.             call KillCommie;
  277.             SetPulse(strikeRate);
  278.         }
  279.     }
  280.  
  281.     # Intro scenes do their own cleanup
  282.     if (b_IntroDone && b_CommieIntroDone)
  283.     {
  284.         TeleportThing(player, indy);
  285.         
  286.         SetCameraPosition(1, GetThingPos(cam2));
  287.         Sleep(0.01);
  288.         ResetCameraFOV(0, 0.0);
  289.         SetCurrentCamera(1);
  290.  
  291.         # Clean up temp cam stuff
  292.         DestroyThing(curCamLocus);
  293.         DestroyThing(curCamFocus);
  294.         Sleep(0.01);
  295.  
  296.         ClearThingFlags(player, 0x80000);
  297.         SetThingFlags(indy, 0x80000);
  298.         EndCutscene();
  299.         ClearActorFlags(player, 0x200000);
  300.     }
  301.  
  302.     Sleep(0.5);
  303.     MoveToFrame(button, 0, 1);
  304.  
  305.     return;
  306. }
  307. else if (sender == blastDoor1)
  308. {
  309.     SetCollideType(blastDoor0, 3);
  310.     SetCollideType(blastDoor1, 3);
  311.     return;
  312. }
  313. else if (sender == volodnikov)
  314. {
  315.     ResetCameraFOV(0, 0.0);
  316.     SetCurrentCamera(1);
  317.  
  318.     TeleportThing(player, indy);
  319.     SetThingFlags(indy, 0x80000);
  320.     ClearThingFlags(player, 0x80000);
  321.     ClearActorFlags(player, 0x200000);
  322.  
  323.     DestroyThing(volodnikov);
  324.     EndCutscene();
  325.  
  326.     SendMessageEx(nub_Commie_Grid, user3, commie0, commie1, commie2, 0);
  327.  
  328.     b_CommieIntroDone = 1;
  329.  
  330.     return;
  331. }
  332. else if (sender == button)
  333. {
  334.     return;
  335. }
  336.  
  337. for(index = 0; index < 3; index = index + 1)
  338. {
  339.     if (sender == commie0[index])
  340.     {
  341.         if (comFrame0[index] < 2)
  342.         {
  343.             AISetLookFrame(commie0[index], 2);
  344.             AISetMoveFrame(commie0[index], 2);
  345.             comFrame0[index] = 2;
  346.             return;
  347.         }
  348.         else
  349.         {
  350.             ReleaseThing(commie0[index]);
  351.             AIClearCutsceneMode(commie0[index]);
  352.             return;
  353.         }
  354.     }
  355. }
  356.  
  357. return;
  358.  
  359. # -------------------------------------------------------------------
  360.  
  361. entered:
  362.  
  363. sender = GetSenderRef();
  364. source = GetSourceRef();
  365.  
  366. # Everything below triggered only by player
  367. if (source != player) return;
  368.  
  369. if (sender == triggersector)
  370. {
  371.     if (b_IntroDone) return;
  372.  
  373.     call LightningIntro;
  374. }
  375. else if (sender == climbFace)
  376. {
  377.     SetCollideType(tower, 0); # Turn off tower's collision when Indy climbs out
  378. }
  379. else if (sender == climbout)
  380. {
  381.     Sleep(1.0);
  382.     SetCollideType(tower, 3); # Restore tower's collision
  383.     SetThingFlags(tower, 0x40); # Set stand on bit
  384. }
  385.  
  386. return;
  387.  
  388. # -------------------------------------------------------------------
  389.  
  390. touched: # Indy touched the probe...heh
  391.  
  392. # Quick exit conditions...
  393. if (b_Disabled) return;
  394. if (b_TouchOfDeath) return;
  395. if (GetSenderRef() != probe) return;
  396. if (GetSourceRef() != player) return;
  397. if (GetCurFrame(probe) != 0) return;
  398. if (!b_LightningOn) return;
  399. if (GetHealth(player) <= 0) return;
  400.  
  401. b_TouchOfDeath = 1;
  402.  
  403. SetCameraFocus(2, ballTarget);
  404. SetCameraSecondaryFocus(2, probe);
  405. SetCurrentCamera(2);
  406. SetCameraFOV(120, 0, 0.0);
  407.  
  408. SetMaterialCel(ballMat, 1);
  409.  
  410. tempThing = CreateThing(glowTpl, probe);
  411. AnimateSpriteSize(tempThing, '0.25 0.25 1.0', '0.35 0.35 0.0', 1.0);
  412. SetLifeLeft(tempThing, 1.1);
  413.  
  414. PlaySoundThing(fireSnd, probe, 1.0, -1, -1, 0x880);
  415.  
  416. SetThingFlags(player, 0x10);
  417.  
  418. deadIndy = CreateThing(GetThingTemplate(indy), player);
  419. CopyPlayerHolsters(player, deadIndy);
  420. ClearThingFlags(deadIndy, 0x80000);
  421.  
  422. PlayKey(deadIndy, in_DieShock, 5, 0x14, 0);
  423.  
  424. Sleep(0.7); 
  425. DamageThing(player, 1000, 0x100000, probe);
  426. b_TouchOfDeath = 0;
  427.  
  428. return;
  429.  
  430. # -------------------------------------------------------------------
  431.  
  432. pulse:
  433.  
  434. curTarget = player;
  435. curDamage = (GetDifficulty() + Rand()) * 100;
  436.  
  437. call LightningStrike;
  438.  
  439. if (GetHealth(player) > 0 && b_ZappedIndy) # If Indy is still alive & atually got hit..
  440. {
  441.     if (!BitTest(GetThingFlags(player), 0x2000000)) # Indy is not swimming
  442.     {
  443.         PlayVoiceMode(player, 92);
  444.  
  445.         moveStatus = GetMoveStatus(player);
  446.         if ((moveStatus >= 0) && (moveStatus <= 2)) # Still, walking and running ONLY
  447.         {
  448.             MakeMeStop();
  449.             PlayKey(player, in_Shock, 4, 0x12, 1);
  450.             ClearActorFlags(player, 0x200000);
  451.         }
  452.     }
  453. }
  454. else
  455. {
  456.     call SetTargetRandom; 
  457.     call LightningStrike;
  458. }
  459.  
  460. return;
  461.  
  462. # -------------------------------------------------------------------
  463.  
  464. user0: # Sent by nub_h2oswitch.cog -- disables lightning
  465.  
  466. SetPulse(0);
  467. b_LightningOn = 0;
  468. return;
  469.  
  470. # -------------------------------------------------------------------
  471.  
  472. user1: # Sent by nub_h2oswitch.cog -- enables lightning
  473.  
  474. SetPulse(strikeRate);
  475. b_LightningOn = 1;
  476. return;
  477.  
  478. # -------------------------------------------------------------------
  479.  
  480. user2: # Sent by nub_h2oswitch.cog -- IMP4 has been taken
  481.  
  482. b_Disabled = 1;
  483. return;
  484.  
  485. # -------------------------------------------------------------------
  486.  
  487. SetTargetRandom:
  488.  
  489. # If the probe is up, blast the heads
  490. if (GetCurFrame(probe) == 0)
  491. {
  492.     curTarget = head0[RandBetween(0, 2)];
  493. }
  494. # Otherwise, hit the ghosts around the pool
  495. else
  496. {
  497.     curTarget = randtarget0[RandBetween(0, 5)];
  498. }
  499. curDamage = 0;
  500.  
  501. return;
  502.  
  503. # -------------------------------------------------------------------
  504.  
  505. LightningStrike: # curTarget and curDamage must already be set!
  506.  
  507. PlaySoundThing(chargingSnd, probe, 1.0, 20, 40, 0x880);
  508. #Sleep(1.0);
  509.  
  510. SetMaterialCel(ballMat, 1);
  511.  
  512. glow = CreateThing(glowTpl, probe);
  513. AnimateSpriteSize(glow, '0.25 0.25 1.0', '0.35 0.35 0.0', 1.0);
  514. SetLifeLeft(glow, 1.1);
  515.  
  516. PlaySoundThing(fireSnd, probe, 1.0, -1, -1, 0x880);
  517.  
  518. Sleep(0.5);
  519.  
  520. for (count = 0; count < 2; count = count + 1)
  521. {
  522.     CreatePolylineThing(lightningGhost, probe, '0 0 -1.0', zapMat0[RandBetween(0, 2)], 0.35, 0.35, 0.05);
  523.     Sleep(0.05);
  524. }
  525.  
  526. Sleep(0.01);
  527.  
  528. if (curTarget == player)
  529. {
  530.     # See if we have a line of sight from probe to Indy
  531.     if(HasLOS(probe, player) && !IsInvisible() && !b_TouchOfDeath)
  532.     {
  533.         b_ZappedIndy = 1;
  534.     }
  535.     else
  536.     {
  537.         call SetTargetRandom;
  538.         b_ZappedIndy = 0;
  539.     }
  540. }
  541.  
  542. for (count = 0; count < 2; count = count + 1)
  543. {
  544.     CreatePolylineThing(probe, curTarget, '-0.1 -0.1 0', zapMat0[RandBetween(0, 2)], 0.35, 0.35, 0.05);
  545.     Sleep(0.05);
  546. }
  547.  
  548. SetMaterialCel(ballMat, 0);
  549.  
  550. targetPos = GetThingPos(curTarget);
  551. targetSector = GetThingSector(curTarget);
  552.  
  553. # Push target up a little on Indy & Commie
  554. if ((curTarget == player) || (curTarget == commie0))
  555. {
  556.     targetPos = VectorAdd(targetPos, '0 0 0.035');
  557. }
  558. else if (curTarget == introIndy)
  559. {
  560.     targetPos = VectorAdd(targetPos, '-0.1 -0.1 0.035');
  561. }
  562.  
  563. CreateThingAtPos(sparksTpl, targetSector, targetPos, '0 0 0');
  564. CreateThingAtPos(smokeTpl, targetSector, targetPos, '0 0 0');
  565. glow = CreateThingAtPos(lightHitTpl, targetSector, targetPos, '0 0 0');
  566. SetLifeLeft(glow, 0.5);
  567.  
  568. PlaySoundThing(hitSnd, curTarget, 1.0, -1, -1, 0x880);
  569.  
  570. if (curTarget == player)
  571. {
  572.     # If player is already dead, bail
  573.     if (GetHealth(player) <= 0) return;
  574.  
  575.     if ((GetHealth(player) - curDamage) <= 0)
  576.     {
  577.         # If player is invulnerable, bail...
  578.         if (BitTest(GetActorFlags(player), 0x8)) return;
  579.  
  580.         SetThingFlags(player, 0x10);
  581.  
  582.         deadIndy = CreateThing(GetThingTemplate(indy), player);
  583.         CopyPlayerHolsters(player, deadIndy);
  584.         ClearThingFlags(deadIndy, 0x80000);
  585.  
  586.         PlayKey(deadIndy, in_DieShock, 5, 0x14, 0);
  587.  
  588.         Sleep(1.1); 
  589.         DamageThing(player, 1000, 0x100000, probe);
  590.  
  591.         return;
  592.     }
  593. }
  594.  
  595. DamageThing(curTarget, curDamage, 0x100000, probe);
  596.  
  597. return;
  598.  
  599. # -------------------------------------------------------------------
  600.  
  601. LightningIntro:
  602.  
  603. SetActorFlags(player, 0x200000);
  604. StopThing(player);
  605. MakeMeStop();
  606. StartCutscene(1);
  607.  
  608. SetThingFlags(player, 0x80000);
  609. ClearThingFlags(introIndy, 0x80000);
  610. AISetCutsceneMode(introIndy);
  611. CopyPlayerHolsters(player, introIndy);
  612.  
  613. # Cut to Indy...
  614. SetCameraLookInterp(2, 0);
  615. SetCameraPosInterp(2, 0);
  616. SetCameraFocus(2, cam0);
  617. SetCameraSecondaryFocus(2, indytarg);
  618. SetCurrentCamera(2);
  619. SetCameraFOV(75, 0, 0.0);
  620.  
  621. SetCollideType(probe, 0);
  622. SetCollideType(blastDoor0, 0);
  623. SetCollideType(blastDoor1, 0);
  624.  
  625. inRotRate = GetThingMaxRotVel(introindy);
  626. SetThingMaxRotVel(introindy, 50.0);
  627. inHeadRate = GetThingMaxHeadVel(introindy);
  628. SetThingMaxHeadVel(introindy, 30.0);
  629.  
  630. # Walk Indy into shot...
  631. AISetLookThing(introindy, lt_mk_1);
  632. AISetMoveSpeed(introindy, 1.0);
  633. AISetMoveThing(introindy, lt_mk_1, 0);
  634. Sleep(0.01);
  635. SetCameraFOV(60, 1, 2.5);
  636.  
  637. AIEnableHeadTracking(introindy, probe);
  638.  
  639. AIWaitForStop(introindy);
  640.  
  641. AIDisableHeadTracking(introindy);
  642. AISetLookThing(introindy, probe);
  643.  
  644. PlayVoice(player, interestingSnd, 1.0, 1);
  645. PlaySoundLocal(ballMus, 1.0, 0.0, 0x0, 0);
  646.  
  647. MoveToFrame(probe, 1, 1.0);
  648. MoveToFrame(BlastDoor0, 1, 1.0);
  649. Sleep(0.01); # To prevent sounds from competing
  650. MoveToFrame(BlastDoor1, 1, 1.0);
  651.  
  652. # Pan & tilt to probe...
  653. SetCameraLookInterp(2, 1);
  654. SetCameraPosInterp(2, 1);
  655. SetCameraInterpSpeed(2, 2.0);
  656. Sleep(0.01);
  657. SetCameraSecondaryFocus(2, probetarg);
  658. SetCameraFOV(50, 1, 2.0);
  659.  
  660. Sleep(1.0);
  661.  
  662. MoveToFrame(probe, 1, 1.0);
  663. MoveToFrame(BlastDoor0, 1, 1.0);
  664. Sleep(0.01); # To prevent sounds from competing
  665. MoveToFrame(BlastDoor1, 1, 1.0);
  666.  
  667. Sleep(2.0);
  668.  
  669. ## WaitForStop(probe);
  670.  
  671. curTarget = introIndy;
  672. curDamage = 0;
  673. call LightningStrike;
  674.  
  675. SetPulse(strikeRate); # Start lightning...
  676. b_LightningOn = 1;
  677.  
  678. SetCameraLookInterp(2, 0);
  679. SetCameraPosInterp(2, 0);
  680. SetCameraFocus(2, indyCam);
  681. SetCameraSecondaryFocus(2, volCamTarg);
  682. SetCameraFOV(50, 0, 0.0);
  683.  
  684. SetThingMaxRotVel(introindy, inRotRate);
  685. SetThingMaxHeadVel(introindy, inHeadRate);
  686.  
  687. PlayVoice(introIndy, uhohSnd, 1.0, 0);
  688. PlayKey(introIndy, in_Reaction, 2, 0x12, 1);
  689.  
  690. ResetCameraFOV(0, 0.0);
  691. SetCurrentCamera(1);
  692. ResetCameraFOV(0, 0.0);
  693.  
  694. TeleportThing(player, introindy);
  695. ClearThingFlags(player, 0x80000);
  696. SetThingFlags(introIndy, 0x80000);
  697. DestroyThing(introIndy);
  698. EndCutscene();
  699. ClearActorFlags(player, 0x200000);
  700.  
  701. b_IntroDone = 1;
  702.  
  703. return;
  704.  
  705. # -------------------------------------------------------------------
  706.  
  707. CommieIntro:
  708.  
  709. PlaySoundLocal(comMus, 1.0, 0.0, 0x0, 0);
  710.  
  711. # Remove gun from holster & put it in Volodnikov's hand 
  712. ClearThingFlags(volodnikov, 0x80000);
  713. SetThingMesh(volodnikov, 8, mod_VoGun, 0);
  714. SetThingMesh(volodnikov, 19, mod_VoHolster, 0);
  715.  
  716. # Shot of Volodya ushering his men in...
  717. SetCameraFocus(2, volCam);
  718. SetCameraSecondaryFocus(2, volCamTarg);
  719. SetCurrentCamera(2);
  720. SetCameraFOV(50, 1, 2.5);
  721. SetCameraPosition(1, GetThingPos(cam2));
  722. Sleep(1.0);
  723.  
  724. # Clean up temp cam stuff
  725. DestroyThing(curCamLocus);
  726. DestroyThing(curCamFocus);
  727.  
  728. AIEnableHeadTracking(volodnikov, tower);
  729. Sleep(1.0);
  730.  
  731. PlayKey(volodnikov, vo_Command, 4, 0x12, 0);
  732.  
  733. for(index = 0; index < 3; index = index + 1)
  734. {
  735.     comFrame0[index] = 1; # Start frame counter at 1
  736.  
  737.     ClearThingFlags(commie0[index], 0x80000);
  738.     AISetMoveSpeed(commie0[index], 2.0);
  739.     AISetLookFrame(commie0[index], 1);
  740.     AISetMoveFrame(commie0[index], 1);
  741.     CaptureThing(commie0[index]);        
  742. }
  743.  
  744. Sleep(1.0);
  745. AIDisableHeadTracking(volodnikov);
  746. Sleep(2.0);
  747. CaptureThing(volodnikov);
  748. AISetMoveSpeed(volodnikov, 1.25);
  749. AISetLookThing(volodnikov, volExitTarg);
  750. AISetMoveThing(volodnikov, volExitTarg, 0);
  751.  
  752. return;
  753.  
  754. # -------------------------------------------------------------------
  755.  
  756. KillCommie:
  757.  
  758. if (GetHealth(commie0) > 0) # See if he's till alive...
  759. {
  760.     SetPulse(0);
  761.  
  762.     # Put 'em in cutscene mode & teleport 'em
  763.     for(index = 0; index < 3; index = index + 1)
  764.     {
  765.         TeleportThing(commie0[index], commieTarg0[index]);
  766.         AISetCutsceneMode(commie0[index]);
  767.         StopThing(commie0[index]);
  768.     }
  769.  
  770.     Sleep(0.5); # Let them get into position
  771.  
  772.     SetCameraFocus(2, cam1);
  773.     SetCameraSecondaryFocus(2, commie0);
  774.     SetCurrentCamera(2);
  775.     SetCameraFOV(90, 0, 0);
  776.     SetCameraFOV(30, 1, 2.5);
  777.  
  778.     Sleep(1.0);
  779.  
  780.     PlayKey(commie0, cm_LookAround, 2, 0x12, 0);
  781.  
  782.     curTarget = commie0;
  783.     curDamage = 1000;
  784.     call LightningStrike;
  785.  
  786.     # Let Commie cog know he's zapped...
  787.     SendMessage(nub_Commie_Grid, user4);
  788.  
  789.     Sleep(3.0);
  790.  
  791.     AIClearCutsceneMode(commie1);
  792.     AIClearCutsceneMode(commie2);
  793.  
  794.     SetPulse(strikeRate);
  795. }
  796.  
  797. return;
  798.  
  799. end